From: Eskild Hustvedt Date: Wed, 21 Mar 2012 07:59:39 +0000 (+0100) Subject: dateMenu: Allow extensions to add custom calendar sources X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~1989 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=35fcd1699200b6f5033dbc1fc32ea5732610e2bc;p=gnome-shell.git dateMenu: Allow extensions to add custom calendar sources Splits instantiation of the event source into a separate method, allowing extensions to subclass the DateMenuButton and provide its own calendar source. https://bugzilla.gnome.org/show_bug.cgi?id=672500 --- diff --git a/js/ui/dateMenu.js b/js/ui/dateMenu.js index 4bf22b46e..c46938a28 100644 --- a/js/ui/dateMenu.js +++ b/js/ui/dateMenu.js @@ -173,6 +173,10 @@ const DateMenuButton = new Lang.Class({ } }, + _getEventSource: function() { + return new Calendar.DBusEventSource(); + }, + _setEventSource: function(eventSource) { if (this._eventSource) this._eventSource.destroy(); @@ -190,7 +194,7 @@ const DateMenuButton = new Lang.Class({ let eventSource; let showEvents = Main.sessionMode.showCalendarEvents; if (showEvents) { - eventSource = new Calendar.DBusEventSource(); + eventSource = this._getEventSource(); } else { eventSource = new Calendar.EmptyEventSource(); }